<template>
  <view>
    <u-swiper
      :list="list"
      :mode="mode"
      :duration="duration"
      :circular="true"
      :indicator-pos="indicatorPos"
      @click="toLink"
    ></u-swiper>
  </view>
</template>

<script setup lang="ts">
import { PropType } from "vue";

const props = defineProps({
  list: {
    type: Object as PropType<Array<string>>,
    required: true,
  },
  mode: {
    type: String,
    default: "round",
    validator(value: string) {
      // The value must match one of these strings
      return ["dot", "number", "round", "none"].includes(value);
    },
  },
  duration: {
    type: Number,
    default: 3000,
  },
  indicatorPos: {
    type: String,
    default: "bottomCenter",
    validator(value: string) {
      // The value must match one of these strings
      return [
        "topLeft",
        "topCenter",
        "topRight",
        "bottomLeft",
        "bottomCenter",
        "bottomRight",
      ].includes(value);
    },
  },
  linkAddress: {
    type: Object as PropType<Array<string>>
  }
});

let toLink = function(index:Number){
    
}
</script>

<style lang="scss" scoped></style>
